/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * jifReporteTransferenciasFaltantes.java
 *
 * Created on 30-sep-2010, 9:39:03
 */

package Reportes;

import administracion.helper.Listas;
import administracion.helper.Reportes;
import administracion.helper.Utiles_MensajesDialogo;
import administracion.propiedades.Propiedades;
import java.awt.event.KeyEvent;

import java.util.List;

import java.util.logging.Level;
import java.util.logging.Logger;

import suministros.ejb30.TO.AlmacenTO;
import suministros.ejb30.TO.EmpresaTO;
import suministros.ejb30.TO.SubAlmacenTO;
import suministros.ejb30.TO.ZonaTO;


/**
 *
 * @author Diana
 */
public class jifReporteTransferenciasFaltantes extends javax.swing.JInternalFrame {

    List<ZonaTO> zonas;
    List<EmpresaTO> empresas;
    List<AlmacenTO> almacenes;
    List<SubAlmacenTO> subalmacenes;
    /** Creates new form jifReporteTransferenciasFaltantes */
    public jifReporteTransferenciasFaltantes() {
        initComponents();
        empresas = Listas.getEmpresas();
        if(empresas.isEmpty()){
            this.jCheckBox1.setEnabled(false);
        }
        this.jCheckBox1.setSelected(false);
        this.llenarComboEmpresa();
        this.llenarComboZonas();
        this.jcbEmpresa.setEnabled(false);
    }
     private void llenarComboEmpresa() {
        empresas = null;
        List listaPaises_cbo = this.cboBeanBindingEmpresa1.getLista();
        listaPaises_cbo.clear();
        try
        {
          if(this.jCheckBox1.isSelected()){
                empresas = Listas.getEmpresas();
            }
            else{
                empresas = Listas.getEmpresaPrincipal();
            }
          this.cboBeanBindingEmpresa1.setLista(empresas);
          this.bindingGroup.bind();
          this.jcbEmpresa.updateUI();
          this.jcbEmpresa.setSelectedIndex(0);
        } catch (Exception ex) {
          Utiles_MensajesDialogo.mensajeAlerta("Error al obtener empresas\n" + ex.getMessage());
          ex.printStackTrace();
          Logger.getLogger(jifReporteTransferenciasFaltantes.class.getName()).log(Level.SEVERE, null, ex);
        }
      }
      private void llenarComboZonas() {
        zonas = null;
        List listaPaises_cbo = this.cboBeanBindingZona1.getLista();
        listaPaises_cbo.clear();
        try
        {
          zonas = Listas.getZonas();
          this.cboBeanBindingZona1.setLista(zonas);
          this.bindingGroup.bind();
          this.jcbZona.updateUI();
          this.jcbZona.setSelectedIndex(0);
        } catch (Exception ex) {
          Utiles_MensajesDialogo.mensajeAlerta("Error al obtener zonas\n" + ex.getMessage());
          ex.printStackTrace();
          Logger.getLogger(jifReporteTransferenciasFaltantes.class.getName()).log(Level.SEVERE, null, ex);
        }
      }
      private void llenarComboAlmacenZona() {
           try {
                  if (this.jcbZona.getSelectedItem() != null) {
                    ZonaTO selected = (ZonaTO)this.jcbZona.getSelectedItem();
                    List listaAlmacen = null;
                    List listaAlmacen_cbo = this.cboBeanBindingAlmacen1.getLista();
                    listaAlmacen_cbo.clear();
                    listaAlmacen = Listas.getAlmacenEnZona(selected);
                    this.cboBeanBindingAlmacen1.setLista(listaAlmacen);
                    this.bindingGroup.bind();
                    this.jcbAlmacen.updateUI();
                    this.jcbAlmacen.setSelectedIndex(0);
                  }
          }
            catch (Exception e) {
              Utiles_MensajesDialogo.mensajeAlerta("Error al obtener almacenes\n" + e.getMessage());
              e.printStackTrace();
              Logger.getLogger(jifReporteTransferenciasFaltantes.class.getName()).log(Level.SEVERE, null, e);
            }
     }

     private void llenarComboUbicacionAlmacen() {
       try {
                  if (this.jcbAlmacen.getSelectedItem() != null) {
                    AlmacenTO selected = (AlmacenTO)this.jcbAlmacen.getSelectedItem();
                    List listaSubAlmacen = null;
                    List listaSubAlmacen_cbo = this.cboBeanBindingSubAlmacen1.getLista();
                    listaSubAlmacen_cbo.clear();
                    listaSubAlmacen = Listas.getSubAlmacenEnAlmacen(selected);
                    this.cboBeanBindingSubAlmacen1.setLista(listaSubAlmacen);
                    this.bindingGroup.bind();
                    this.jcbSubAlmacen.updateUI();
                    this.jcbSubAlmacen.setSelectedIndex(0);
                  }
          }
            catch (Exception e) {
              Utiles_MensajesDialogo.mensajeAlerta("Error al obtener Sub Almacenes\n" + e.getMessage());
              e.printStackTrace();
              Logger.getLogger(jifReporteTransferenciasFaltantes.class.getName()).log(Level.SEVERE, null, e);
            }
     }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

        cboBeanBindingEmpresa1 = new administracion.BeanBinding.CboBeanBindingEmpresa();
        cboBeanBindingZona1 = new administracion.BeanBinding.CboBeanBindingZona();
        cboBeanBindingAlmacen1 = new administracion.BeanBinding.cboBeanBindingAlmacen();
        cboBeanBindingSubAlmacen1 = new administracion.BeanBinding.CboBeanBindingSubAlmacen();
        buttonGroup1 = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        jLabel9 = new javax.swing.JLabel();
        jcbZona = new javax.swing.JComboBox();
        jLabel14 = new javax.swing.JLabel();
        jcbAlmacen = new javax.swing.JComboBox();
        jLabel13 = new javax.swing.JLabel();
        jcbSubAlmacen = new javax.swing.JComboBox();
        jbtAceptar = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jrbTransferencias1 = new javax.swing.JRadioButton();
        jrbTransferencias2 = new javax.swing.JRadioButton();
        jrbTransferencias3 = new javax.swing.JRadioButton();
        jPanel3 = new javax.swing.JPanel();
        jCheckBox1 = new javax.swing.JCheckBox();
        jcbEmpresa = new javax.swing.JComboBox();
        jlbtipo = new javax.swing.JLabel();
        jcbTipo = new javax.swing.JComboBox();

        setTitle("REPORTE DE MOVIMIENTOS FALTANTES");

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "CRITERIOS ESPECIFICOS", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(0, 0, 255))); // NOI18N

        jLabel9.setFont(new java.awt.Font("Arial", 1, 12));
        jLabel9.setText("SUCURSAL");

        jcbZona.setFont(new java.awt.Font("Arial", 0, 12));

        org.jdesktop.beansbinding.ELProperty eLProperty = org.jdesktop.beansbinding.ELProperty.create("${lista}");
        org.jdesktop.swingbinding.JComboBoxBinding jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, cboBeanBindingZona1, eLProperty, jcbZona);
        bindingGroup.addBinding(jComboBoxBinding);

        jcbZona.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcbZonaActionPerformed(evt);
            }
        });
        jcbZona.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jcbZonaKeyPressed(evt);
            }
        });

        jLabel14.setFont(new java.awt.Font("Arial", 1, 12));
        jLabel14.setText("ALMACEN:");

        jcbAlmacen.setFont(new java.awt.Font("Arial", 0, 12));

        eLProperty = org.jdesktop.beansbinding.ELProperty.create("${lista}");
        jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, cboBeanBindingAlmacen1, eLProperty, jcbAlmacen);
        bindingGroup.addBinding(jComboBoxBinding);

        jcbAlmacen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcbAlmacenActionPerformed(evt);
            }
        });
        jcbAlmacen.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jcbAlmacenKeyPressed(evt);
            }
        });

        jLabel13.setFont(new java.awt.Font("Arial", 1, 12));
        jLabel13.setText("UBICACION:");

        jcbSubAlmacen.setFont(new java.awt.Font("Arial", 0, 12));

        eLProperty = org.jdesktop.beansbinding.ELProperty.create("${lista}");
        jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, cboBeanBindingSubAlmacen1, eLProperty, jcbSubAlmacen);
        bindingGroup.addBinding(jComboBoxBinding);

        jcbSubAlmacen.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jcbSubAlmacenKeyPressed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel9)
                    .addComponent(jcbZona, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(11, 11, 11)
                        .addComponent(jLabel14))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jcbAlmacen, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jcbSubAlmacen, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel13))
                .addContainerGap(86, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(jLabel13)
                    .addComponent(jLabel14))
                .addGap(7, 7, 7)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jcbSubAlmacen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jcbZona, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jcbAlmacen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
        );

        jbtAceptar.setFont(new java.awt.Font("Arial", 1, 12));
        jbtAceptar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/iconoscomb/16x16ozygen/actions/button_ok.png"))); // NOI18N
        jbtAceptar.setMnemonic('A');
        jbtAceptar.setText("ACEPTAR");
        jbtAceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtAceptarActionPerformed(evt);
            }
        });
        jbtAceptar.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jbtAceptarKeyPressed(evt);
            }
        });

        jButton2.setFont(new java.awt.Font("Arial", 1, 12));
        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/iconoscomb/16x16ozygen/actions/button_cancel.png"))); // NOI18N
        jButton2.setMnemonic('C');
        jButton2.setText("CERRAR");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "TIPO DE INFORME", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(0, 0, 255))); // NOI18N

        buttonGroup1.add(jrbTransferencias1);
        jrbTransferencias1.setText("TRANSFERENCIAS DE TODOS LOS ALMACENES");
        jrbTransferencias1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrbTransferencias1ActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrbTransferencias2);
        jrbTransferencias2.setText("TRANSFERENCIAS DE UNA UBICACION ESPECIFICA");
        jrbTransferencias2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrbTransferencias2ActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrbTransferencias3);
        jrbTransferencias3.setText("NOTAS DE INGRESO QUE NO SE HAN UBICADO");
        jrbTransferencias3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrbTransferencias3ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jrbTransferencias1)
                    .addComponent(jrbTransferencias2)
                    .addComponent(jrbTransferencias3))
                .addContainerGap(300, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jrbTransferencias1, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jrbTransferencias2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jrbTransferencias3))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "CRITERIOS GENERALES", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(0, 0, 255))); // NOI18N

        jCheckBox1.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jCheckBox1.setText("OTRAS EMPRESAS");
        jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox1ActionPerformed(evt);
            }
        });

        eLProperty = org.jdesktop.beansbinding.ELProperty.create("${lista}");
        jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, cboBeanBindingEmpresa1, eLProperty, jcbEmpresa);
        bindingGroup.addBinding(jComboBoxBinding);

        jcbEmpresa.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jcbEmpresaKeyPressed(evt);
            }
        });

        jlbtipo.setFont(new java.awt.Font("Arial", 1, 12));
        jlbtipo.setText("TIPO DE TRANSF.");

        jcbTipo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "INGRESO", "SALIDA" }));

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jCheckBox1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jcbEmpresa, javax.swing.GroupLayout.PREFERRED_SIZE, 218, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jlbtipo)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jcbTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jCheckBox1)
                    .addComponent(jcbEmpresa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jlbtipo)
                    .addComponent(jcbTipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(layout.createSequentialGroup()
                .addGap(172, 172, 172)
                .addComponent(jbtAceptar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton2)
                .addContainerGap(207, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(5, 5, 5)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jbtAceptar)
                    .addComponent(jButton2))
                .addContainerGap(23, Short.MAX_VALUE))
        );

        bindingGroup.bind();

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed
        if(this.jCheckBox1.isSelected()){
            this.jcbEmpresa.setEnabled(true);
        } else{
            this.jcbEmpresa.setEnabled(false);
        }
        this.llenarComboEmpresa();

}//GEN-LAST:event_jCheckBox1ActionPerformed

    private void jcbEmpresaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jcbEmpresaKeyPressed
        if (evt.getKeyCode() == KeyEvent.VK_ENTER ){
            if(this.jcbEmpresa.getSelectedIndex()>=0){
                this.jcbZona.requestFocus();
            }
        }
}//GEN-LAST:event_jcbEmpresaKeyPressed

    private void jbtAceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtAceptarActionPerformed
       if(this.jrbTransferencias3.isSelected()){
            String emp=empresas.get(this.jcbEmpresa.getSelectedIndex()).getCodigo();
            try {
                Reportes.verIngresoFaltanteUbicar(emp, Propiedades.getUsuario());
            } catch (Exception ex) {
                Logger.getLogger(jifReporteTransferenciasFaltantes.class.getName()).log(Level.SEVERE, null, ex);
            }
       }
       if(this.jrbTransferencias2.isSelected()){
         if(this.jcbSubAlmacen.getSelectedIndex()>=0){
            if(this.jcbTipo.getSelectedIndex()==0){
            String emp=empresas.get(this.jcbEmpresa.getSelectedIndex()).getCodigo();
            String ubicacion=((SubAlmacenTO)(this.jcbSubAlmacen.getSelectedItem())).getCodSubAlmacen();
            try {
                Reportes.verTransferenciaIngresoFaltanteUbicacion(emp, Propiedades.getUsuario(),ubicacion);
            } catch (Exception ex) {
                Logger.getLogger(jifReporteTransferenciasFaltantes.class.getName()).log(Level.SEVERE, null, ex);
            }
            }
            if(this.jcbTipo.getSelectedIndex()==1){
                String emp=empresas.get(this.jcbEmpresa.getSelectedIndex()).getCodigo();
                String ubicacion=((SubAlmacenTO)(this.jcbSubAlmacen.getSelectedItem())).getCodSubAlmacen();
                try {
                    Reportes.verTransferenciaSalidaFaltanteUbicacion(emp, Propiedades.getUsuario(),ubicacion);
                } catch (Exception ex) {
                    Logger.getLogger(jifReporteTransferenciasFaltantes.class.getName()).log(Level.SEVERE, null, ex);
                }
            }

            }
            else{
                Utiles_MensajesDialogo.mensajeAlerta("No se ha seleccionado una ubicacion espeficica");
            }
       }
       if(this.jrbTransferencias1.isSelected()){
           if(this.jcbTipo.getSelectedIndex()==0){
            String emp=empresas.get(this.jcbEmpresa.getSelectedIndex()).getCodigo();
            try {
                Reportes.verTransferenciaIngresoFaltante(emp, Propiedades.getUsuario());
            } catch (Exception ex) {
                Logger.getLogger(jifReporteTransferenciasFaltantes.class.getName()).log(Level.SEVERE, null, ex);
            }
            }
            if(this.jcbTipo.getSelectedIndex()==1){
                String emp=empresas.get(this.jcbEmpresa.getSelectedIndex()).getCodigo();
                try {
                    Reportes.verTransferenciaSalidaFaltante(emp, Propiedades.getUsuario());
                } catch (Exception ex) {
                    Logger.getLogger(jifReporteTransferenciasFaltantes.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
       }

}//GEN-LAST:event_jbtAceptarActionPerformed

    private void jbtAceptarKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jbtAceptarKeyPressed
        if (evt.getKeyCode() == KeyEvent.VK_ENTER ){
            this.jbtAceptar.doClick();
        }
}//GEN-LAST:event_jbtAceptarKeyPressed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        int res = javax.swing.JOptionPane.showConfirmDialog( this,"Esta seguro de salir?",
                "Confirmar",javax.swing.JOptionPane.YES_NO_OPTION );
        if(res==javax.swing.JOptionPane.YES_OPTION){
            this.dispose();
        }
}//GEN-LAST:event_jButton2ActionPerformed

    private void jcbZonaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbZonaActionPerformed
        if(this.jcbZona.getSelectedIndex()>=0){
            llenarComboAlmacenZona();
        }
}//GEN-LAST:event_jcbZonaActionPerformed

    private void jcbZonaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jcbZonaKeyPressed
        if (evt.getKeyCode() == KeyEvent.VK_ENTER ){
            this.jcbAlmacen.requestFocus();
        }
}//GEN-LAST:event_jcbZonaKeyPressed

    private void jcbAlmacenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbAlmacenActionPerformed
        if(this.jcbAlmacen.getSelectedIndex()>=0){
            this.llenarComboUbicacionAlmacen();
        }
}//GEN-LAST:event_jcbAlmacenActionPerformed

    private void jcbAlmacenKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jcbAlmacenKeyPressed
        if (evt.getKeyCode() == KeyEvent.VK_ENTER ){
            this.jcbSubAlmacen.requestFocus();
        }
}//GEN-LAST:event_jcbAlmacenKeyPressed

    private void jcbSubAlmacenKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jcbSubAlmacenKeyPressed
        if (evt.getKeyCode() == KeyEvent.VK_ENTER ){
            this.jcbZona.requestFocus();
        }
}//GEN-LAST:event_jcbSubAlmacenKeyPressed

    private void jrbTransferencias1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbTransferencias1ActionPerformed
       if(this.jrbTransferencias1.isSelected()){
           this.jPanel1.setVisible(false);
       }
       if(this.jrbTransferencias2.isSelected()){
           this.jPanel1.setVisible(true);
       }
       this.jcbTipo.setVisible(true);
       this.jlbtipo.setVisible(true);
       this.pack();

    }//GEN-LAST:event_jrbTransferencias1ActionPerformed

    private void jrbTransferencias2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbTransferencias2ActionPerformed
       if(this.jrbTransferencias1.isSelected()){
           this.jPanel1.setVisible(false);
       }
       if(this.jrbTransferencias2.isSelected()){
           this.jPanel1.setVisible(true);
       }
       this.jcbTipo.setVisible(true);
       this.jlbtipo.setVisible(true);
       this.pack();
    }//GEN-LAST:event_jrbTransferencias2ActionPerformed

    private void jrbTransferencias3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbTransferencias3ActionPerformed
       this.jPanel1.setVisible(false);
       this.jcbTipo.setVisible(false);
       this.jlbtipo.setVisible(false);
       this.pack();
    }//GEN-LAST:event_jrbTransferencias3ActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private administracion.BeanBinding.cboBeanBindingAlmacen cboBeanBindingAlmacen1;
    private administracion.BeanBinding.CboBeanBindingEmpresa cboBeanBindingEmpresa1;
    private administracion.BeanBinding.CboBeanBindingSubAlmacen cboBeanBindingSubAlmacen1;
    private administracion.BeanBinding.CboBeanBindingZona cboBeanBindingZona1;
    private javax.swing.JButton jButton2;
    private javax.swing.JCheckBox jCheckBox1;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JButton jbtAceptar;
    private javax.swing.JComboBox jcbAlmacen;
    private javax.swing.JComboBox jcbEmpresa;
    private javax.swing.JComboBox jcbSubAlmacen;
    private javax.swing.JComboBox jcbTipo;
    private javax.swing.JComboBox jcbZona;
    private javax.swing.JLabel jlbtipo;
    private javax.swing.JRadioButton jrbTransferencias1;
    private javax.swing.JRadioButton jrbTransferencias2;
    private javax.swing.JRadioButton jrbTransferencias3;
    private org.jdesktop.beansbinding.BindingGroup bindingGroup;
    // End of variables declaration//GEN-END:variables

}
